Skip to contentSkip to conversation

fetch2/wget.py: use default wget user-agent in upstream version checks

PATCH In review Alexander Kanavin 4 participants 8 messages Oct 14, 2024 – Jan 21, 2025 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/wget.py: use default wget user-agent in upstream version checks

From: Alexander Kanavin <[email protected]>

This has been set to various mozilla versions from this point onwards without explanation or specific examples:
https://git.yoctoproject.org/poky/commit/?h=master-next&id=ba06cc8943d021f406c3d292ce415b77319ca5c6

However, sourceforge has recently banned the current 'fake mozilla' version we've been supplying, resulting in broken version checks:

alex@Zen2:/srv/storage/alex/yocto/build-test-sourceforge$ devtool check-upgrade-status gptfdisk
...
--2024-10-12 11:53:23--  https://sourceforge.net/projects/gptfdisk/files/gptfdisk/
Resolving sourceforge.net (sourceforge.net)... 172.64.150.145, 104.18.37.111, 2606:4700:4400::6812:256f, ...
Connecting to sourceforge.net (sourceforge.net)|172.64.150.145|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2024-10-12 11:53:24 ERROR 403: Forbidden.

gptfdisk 1.0.10 UNKNOWN_BROKEN Alexander Kanavin <[email protected]>

On the other hand, using wget's default user-agent works just fine:

--2024-10-12 12:16:06-- https://sourceforge.net/projects/gptfdisk/files/gptfdisk/
Resolving sourceforge.net (sourceforge.net)... 104.18.37.111, 172.64.150.145, 2606:4700:4400::6812:256f, ... Connecting to sourceforge.net (sourceforge.net)|104.18.37.111|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

---
 bitbake/lib/bb/fetch2/wget.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bitbake/lib/bb/fetch2/wget.py +1 -1
index e8b1292433f..493a5b62ee2 100644
@@ -463,7 +463,7 @@ class Wget(FetchMethod):
         f = tempfile.NamedTemporaryFile()
         with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
             fetchcmd = self.basecmd
-            fetchcmd += " -O " + f.name + " --user-agent='" + self.user_agent + "' '" + uri + "'"
+            fetchcmd += " -O " + f.name + " '" + uri + "'"
             try:
                 self._runwget(ud, d, fetchcmd, True, workdir=workdir)
                 fetchresult = f.read()
Signature · 1 line
2.39.5
#1 lore raw
Quoted 9 lines · Alexander Kanavin via lists.openembedded.org

From: Alexander Kanavin <[email protected]>

This has been set to various mozilla versions from this point onwards without explanation or specific examples:
https://git.yoctoproject.org/poky/commit/?h=master-next&id=ba06cc8943d021f406c3d292ce415b77319ca5c6

However, sourceforge has recently banned the current 'fake mozilla' version we've been supplying, resulting in broken version checks:

Of course for fun we’ve just discovered that the openjdk mercurial repository rejects wget/curl and you need to fake a browser U-A to download files…

Ross

#2 lore raw

This has been discussed before. Taking things from mercurial with wget is explicitly disallowed and there’s an official location for those tarballs. I’ll find that thread when I get to a real computer.

Alex

Quoted 20 lines · Ross Burton
Quoted 4 lines · Alexander Kanavin via lists.openembedded.org

From: Alexander Kanavin <[email protected]>

This has been set to various mozilla versions from this point onwards

without

Quoted 2 lines

explanation or specific examples:

https://git.yoctoproject.org/poky/commit/?h=master-next&id=ba06cc8943d021f406c3d292ce415b77319ca5c6

Quoted 2 lines

However, sourceforge has recently banned the current 'fake mozilla'

version

Quoted 1 line

we've been supplying, resulting in broken version checks:

Of course for fun we’ve just discovered that the openjdk mercurial repository rejects wget/curl and you need to fake a browser U-A to download files…

Ross

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 4 lines · Alexander Kanavin
Quoted 1 line · Alexander Kanavin via lists.openembedded.org
Quoted 8 lines
Quoted 1 line

This has been discussed before. Taking things from mercurial with wget

is explicitly disallowed and there’s an official location for those tarballs. I’ll find that thread when I get to a real computer.

Found it:
https://lists.openembedded.org/g/bitbake-devel/message/16359

Just to add some more insights for folks unaware, the
https://openjdk-sources.osci.io/openjdk8/openjdk8u272-ga.tar.xz type tarballs are complete, and include hotspot, corba, jaxp, jaxws, etc.

We do need other download locations for the ports though (aarch64 and aarch32), at least until we update to a hypothetical release where those ports are merged into mainline OpenJDK.

In the past, each of the components (jdk, hotspot, corba, jaxp, jaxws, etc.) had to be tracked (changesets) and downloaded separately. There is a lot of complicated machinery in meta-java to handle that old model. If someone is motivated to help simplify and update (for master/walnascar, we can discuss backport policy once things actually build and merge) that would be a helpful contribution.

Quoted 2 lines

Alex

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw
Quoted 3 lines · Livius via lists.openembedded.org

https://lists.openembedded.org/g/bitbake-devel/message/16352

User-agent issue will be happened time to time and it will never stop. This is why i pushed a patch/solution to be able to configure it easly from recipe codes, but nobody from you was interested in it. Now it would have easily solved this problem.

The correct solution is to fix meta-java. Please focus your energy there, rather than trying to portray this as some kind of persistent, wide-spread issue (it isn't).

Alex

A message that is not in the archive (sent off-list or not yet received): [email protected]